﻿namespace Stickam_Client
{
    [DesignerGenerated]
    public __gc class Form_UserInfo : public Form
    {
        // Methods
        [DebuggerNonUserCode]
        public: Form_UserInfo()
        {
            base->Load += new EventHandler __gc*(this.Form_UserInfo_Load);
            this->InitializeComponent();
        }

        [DebuggerNonUserCode]
        protected: override void __gc* Dispose(Boolean __gc* disposing)
        {
            try
            {
                if (disposing && (this->components != 0))
                {
                    this->components->Dispose();
                }
            }
            finally
            {
                base->Dispose(disposing);
            }
        }

        private: void __gc* Form_UserInfo_Load(Object __gc* sender, EventArgs __gc* e)
        {
            this->ProfileLink->Text = Conversions::ToString(Operators::AddObject(S"http://www.stickam.com/", this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->userName)));
            String __gc* right = S"Guest";
            if (Conversions::ToBoolean(this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->isModerator)))
            {
                right = S"Mod";
            }
            if (Conversions::ToBoolean(this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->isOwner)))
            {
                right = S"Owner";
            }
            if (Conversions::ToBoolean(this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->isVideo)))
            {
                right = String::Concat(right, S", on cam");
            }
            if (Conversions::ToBoolean(this->FormParent->Userlist->getParam(this->UserID, *static_cast<__box Int32*>(-(this->FormParent->Userlist->isIgnored > false)))))
            {
                right = String::Concat(right, S", ignored.");
            }
            else
            {
                right = String::Concat(right, S", unignored.");
            }
            this->InRoomInfo->Text = Conversions::ToString(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(Operators::AddObject(S"Display Name: ", this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->screenName)), S"\r\n"), S"Status: "), right), S"\r\n"), S"Username: "), this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->userName)), S"\r\n"), S"User ID: "), this->UserID), S"\r\n"), S"Hex ID: 0x"), Conversion::Hex(RuntimeHelpers::GetObjectValue(Conversion::Int(this->UserID)))));
            __gc new Thread(new ThreadStart __gc*(this.LoadProfileInfo))->Start();
        }

        [DebuggerStepThrough]
        private: void __gc* InitializeComponent()
        {
            ComponentResourceManager __gc* manager = __gc new ComponentResourceManager(__typeof(Form_UserInfo));
            this->ProfileImage = __gc new PictureBox();
            this->GroupBox1 = __gc new GroupBox();
            this->InRoomInfo = __gc new Label();
            this->ProfileInfo = __gc new Label();
            this->ProfileLink = __gc new LinkLabel();
            this->Label1 = __gc new Label();
            *static_cast<__box ISupportInitialize*>(this->ProfileImage)->BeginInit();
            this->GroupBox1->SuspendLayout();
            this->SuspendLayout();
            this->ProfileImage->InitialImage = 0;
            Point __gc* point = (9, 1);
            this->ProfileImage->Location = point;
            this->ProfileImage->Name = S"ProfileImage";
            Size __gc* size = (120, 90);
            this->ProfileImage->Size = size;
            this->ProfileImage->SizeMode = PictureBoxSizeMode::StretchImage;
            this->ProfileImage->TabIndex = 0;
            this->ProfileImage->TabStop = false;
            this->GroupBox1->Controls->Add(this->InRoomInfo);
            point = (140, 1);
            this->GroupBox1->Location = point;
            this->GroupBox1->Name = S"GroupBox1";
            size = (180, 0x91);
            this->GroupBox1->Size = size;
            this->GroupBox1->TabIndex = 1;
            this->GroupBox1->TabStop = false;
            this->GroupBox1->Text = S"In-Room Info";
            this->InRoomInfo->AutoSize = true;
            point = (6, 0x10);
            this->InRoomInfo->Location = point;
            this->InRoomInfo->Name = S"InRoomInfo";
            size = (0x39, 13);
            this->InRoomInfo->Size = size;
            this->InRoomInfo->TabIndex = 0;
            this->InRoomInfo->Text = S"[Info Here]";
            this->ProfileInfo->AutoSize = true;
            point = (-2, 0x5e);
            this->ProfileInfo->Location = point;
            this->ProfileInfo->Name = S"ProfileInfo";
            size = (0x59, 13);
            this->ProfileInfo->Size = size;
            this->ProfileInfo->TabIndex = 2;
            this->ProfileInfo->Text = S"[Profile Info Here]";
            this->ProfileLink->AutoSize = true;
            point = (0x38, 0x92);
            this->ProfileLink->Location = point;
            this->ProfileLink->Name = S"ProfileLink";
            size = (0x81, 13);
            this->ProfileLink->Size = size;
            this->ProfileLink->TabIndex = 3;
            this->ProfileLink->TabStop = true;
            this->ProfileLink->Text = S"http://www.stickam.com/";
            this->Label1->AutoSize = true;
            point = (-2, 0x92);
            this->Label1->Location = point;
            this->Label1->Name = S"Label1";
            size = (0x3e, 13);
            this->Label1->Size = size;
            this->Label1->TabIndex = 4;
            this->Label1->Text = S"Profile Link:";
            SizeF __gc* ef = (6, 13);
            this->AutoScaleDimensions = ef;
            this->AutoScaleMode = AutoScaleMode::Font;
            size = (0x141, 160);
            this->ClientSize = size;
            this->Controls->Add(this->Label1);
            this->Controls->Add(this->ProfileLink);
            this->Controls->Add(this->ProfileInfo);
            this->Controls->Add(this->ProfileImage);
            this->Controls->Add(this->GroupBox1);
            this->FormBorderStyle = FormBorderStyle::FixedToolWindow;
            this->Icon = *static_cast<__box Icon*>(manager->GetObject(S"$this.Icon"));
            this->Name = S"Form_UserInfo";
            this->StartPosition = FormStartPosition::Manual;
            this->Text = S"User Info";
            *static_cast<__box ISupportInitialize*>(this->ProfileImage)->EndInit();
            this->GroupBox1->ResumeLayout(false);
            this->GroupBox1->PerformLayout();
            this->ResumeLayout(false);
            this->PerformLayout();
        }

        private: void __gc* LoadProfileInfo()
        {
            String __gc* str = this->RemoveSpaces(this->FormParent->getWebpage(Conversions::ToString(Operators::AddObject(S"http://www.stickam.com/profile/", this->FormParent->Userlist->getParam(this->UserID, this->FormParent->Userlist->userName)))));
            String __gc* str4 = Strings::Mid(str, (Strings::InStr(str, S"<div class=\"profileImage\">", CompareMethod::Binary) + 0x24));
            this->ProfileImage->ImageLocation = Strings::Mid(str4, 1, (Strings::InStr(str4, S"\"", CompareMethod::Binary) - 1));
            String __gc* str2 = S"N/A";
            String __gc* str3 = S"N/A";
            String __gc* str6 = S"N/A";
            String __gc* str5 = S"N/A";
            if (Strings::InStr(str, S"Age:", CompareMethod::Binary) != 0)
            {
                str2 = Strings::Mid(str, (Strings::InStr(str, S"Age:", CompareMethod::Binary) + 0x10));
                str2 = Strings::Mid(str2, 1, (Strings::InStr(str2, S"<", CompareMethod::Binary) - 1));
            }
            if (Strings::InStr(str, S"Gender:", CompareMethod::Binary) != 0)
            {
                str3 = Strings::Mid(str, (Strings::InStr(str, S"Gender:", CompareMethod::Binary) + 0x13));
                str3 = Strings::Mid(str3, 1, (Strings::InStr(str3, S"<", CompareMethod::Binary) - 1));
            }
            if (Strings::InStr(str, S"Profile Views:", CompareMethod::Binary) != 0)
            {
                str6 = Strings::Mid(str, (Strings::InStr(str, S"Profile Views:", CompareMethod::Binary) + 0x1a));
                str6 = Strings::Mid(str6, 1, (Strings::InStr(str6, S"<", CompareMethod::Binary) - 1));
            }
            if (Strings::InStr(str, S"Member Since:", CompareMethod::Binary) != 0)
            {
                str5 = Strings::Mid(str, (Strings::InStr(str, S"Member Since:", CompareMethod::Binary) + 0x17));
                str5 = Strings::Mid(str5, 1, (Strings::InStr(str5, S"<", CompareMethod::Binary) - 1));
            }
            this->ProfileInfo->Text = String::Concat(__gc new String __gc*[8] {
                S"Age: ", str2, S"\r\nGender: ", str3, S"\r\nProfile Views: ", str6, S"\r\nMember Since: ", str5});
        }

        private: void __gc* ProfileLink_LinkClicked(Object __gc* sender, LinkLabelLinkClickedEventArgs __gc* e)
        {
            Process::Start(this->ProfileLink->Text);
        }

        private: String __gc* RemoveSpaces(String __gc* HtmlData)
        {
            return Strings::Replace(Strings::Replace(HtmlData, S"\t", S"", 1, -1, CompareMethod::Binary), S"\r\n", S"", 1, -1, CompareMethod::Binary);
        }


        // Properties
        [DebuggerNonUserCode]
        public private: __property virtual GroupBox __gc* get_GroupBox1()
        {
            return this->_GroupBox1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_GroupBox1(GroupBox __gc* WithEventsValue)
        {
            this->_GroupBox1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_InRoomInfo()
        {
            return this->_InRoomInfo;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_InRoomInfo(Label __gc* WithEventsValue)
        {
            this->_InRoomInfo = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label1()
        {
            return this->_Label1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label1(Label __gc* WithEventsValue)
        {
            this->_Label1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual PictureBox __gc* get_ProfileImage()
        {
            return this->_ProfileImage;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_ProfileImage(PictureBox __gc* WithEventsValue)
        {
            this->_ProfileImage = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_ProfileInfo()
        {
            return this->_ProfileInfo;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_ProfileInfo(Label __gc* WithEventsValue)
        {
            this->_ProfileInfo = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual LinkLabel __gc* get_ProfileLink()
        {
            return this->_ProfileLink;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_ProfileLink(LinkLabel __gc* WithEventsValue)
        {
            LinkLabelLinkClickedEventHandler __gc* handler = new LinkLabelLinkClickedEventHandler __gc*(this.ProfileLink_LinkClicked);
            if (this->_ProfileLink != 0)
            {
                this->_ProfileLink->LinkClicked -= handler;
            }
            this->_ProfileLink = WithEventsValue;
            if (this->_ProfileLink != 0)
            {
                this->_ProfileLink->LinkClicked += handler;
            }
        }


        // Fields
        [AccessedThroughProperty(S"GroupBox1")]
        private: GroupBox __gc* _GroupBox1;
        [AccessedThroughProperty(S"InRoomInfo")]
        private: Label __gc* _InRoomInfo;
        [AccessedThroughProperty(S"Label1")]
        private: Label __gc* _Label1;
        [AccessedThroughProperty(S"ProfileImage")]
        private: PictureBox __gc* _ProfileImage;
        [AccessedThroughProperty(S"ProfileInfo")]
        private: Label __gc* _ProfileInfo;
        [AccessedThroughProperty(S"ProfileLink")]
        private: LinkLabel __gc* _ProfileLink;
        private: IContainer __gc* components;
        public: Form1 __gc* FormParent;
        public: String __gc* UserID;
    };
}

